package com.ymh.spring.learn.sw.demo5;

public class MethodMonitor {

	private long start;

	private String method;

	public MethodMonitor(String method) {
		this.method = method;
		System.out.println("Begin monitor...");
		this.start = System.currentTimeMillis();
	}

	public void log() {
		long elapsedTime = System.currentTimeMillis() - start;
		System.out.println("end monitor..");
		System.out.println("Method: " + method + ",execution time:" + elapsedTime + " milliseconds.");
	}

}
